package com.jiukuaidao.zhulin.api;

import com.jiukuaidao.library.Config;
import com.jiukuaidao.library.net.ApiCusParamAbstract;
import com.jiukuaidao.zhulin.util.RetrofitUtil;

import retrofit2.Call;
import retrofit2.Callback;

/**
 * Author : BinarySatan
 * Date : 2016/5/25
 * Description : 反解析
 */
public class ApiGeocoding<T> extends ApiCusParamAbstract<T> {

    public ApiGeocoding(double longitude, double latitude, Callback<T> callback) {
        super(callback);

        StringBuffer location = new StringBuffer();
        location.append(latitude).append(",").append(longitude);
        mParams.put("ak", Config.KEY.BAIDU_SERVER_AK);
        mParams.put("output", "json");
        mParams.put("pois", "1");
        mParams.put("location", location.toString());
    }

    @Override
    public Call getCall() {
        return RetrofitUtil.getApiManager(Config.URLConfig.BASE_BAIDU, null, null).geocoding(mParams);
    }
}
